import request from '@/request/require.js'
import qs from 'qs'

// 精品
export const JingPinAPI = () => request.get('products/recommend');
//热门
export const ReMenAPI = () => request.get('products/hot');
// 获取短信验证码
export const SendSMSAPI = (params) => request.post('/sendSMS', qs.stringify(params))

// 手机号验证码登录
export const PhoneReginAPI = (params) => request.post('/phoneRegin', qs.stringify(params))

// 微信扫码登录 /wechatUsers/PCLogin
export const WenXinLoginAPI = (params) => request.post('/wechatUsers/PCLogin', qs.stringify(params))

// 手机绑定微信/wechatUsers/binding
export const BindingAPI = (params) => request.post('/wechatUsers/binding', qs.stringify(params))

// 获取用户信息/shop/userProfiles
export const UserProfilesAPI = () => request.get('/shop/userProfiles');
// 商品详情/products/{id}
export const GoodsDetailsAPI = (id) => request.get(`/products/${id}`)
// 加入购物车/shop/carts/add
export const AddToCartAPI = (params) => request.post('/shop/carts/add', qs.stringify(params))

// 商品搜索/products
export const GoodsSearchAPI = (params) => request.get('/products', { params });
// 购物车数据
export const CartDataApi = () => request.get(`/shop/carts`);
// 查看购物车 /shop/carts
export const CartDataAPI = () => request.get('/shop/carts');